Vue.component("syscript", {
  data() {
    return {
      sval: "",
      view: ""
    }
  },
  props: ["path", "col", "pval"],
  template: `<div style="margin:20px;">
      <el-input v-model="sval" placeholder="刷新脚本的路径 /mod/bag.js" style="width:300px;"></el-input>
      <el-button type="primary" plain @click="opendata(1)">刷新</el-button>
      <pre>{{view}}</pre>
    </div>`,
  methods: {
    opendata: function () { //请求数据
      let $this = this;
      if (this.view) this.view = "";
      http.get("/ajax/" + this.path + "?V=" + this.sval).then(function (res) {
        $this.view = res.data.view;
      });
    }
  }
});